using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;

namespace Common
{
	public class User32API
	{
		public const int GWL_STYLE = -16;

		public const int WS_MAXIMIZE = 16777216;

		public const uint ES_SYSTEM_REQUIRED = 1u;

		public const uint ES_DISPLAY_REQUIRED = 2u;

		public const uint ES_USER_PRESENT = 4u;

		public const uint ES_AWAYMODE_REQUIRED = 64u;

		public const uint ES_CONTINUOUS = 2147483648u;

		[DllImport("User32.dll")]
		public static extern int FindWindow(string lpClassName, string lpWindowName);

		[DllImport("User32.dll")]
		public static extern int SetParent(int hWndChild, int hWndNewParent);

		[DllImport("User32.dll")]
		public static extern int SetWindowLong(int hWnd, int nIndex, long dwNewLong);

		[DllImport("User32.dll")]
		public static extern long GetWindowLong(int hWnd, int nIndex);

		[DllImport("user32.dll")]
		public static extern int MoveWindow(int hWnd, int x, int y, int cx, int cy, bool repaint);

		[DllImport("kernel32.dll")]
		public static extern uint SetThreadExecutionState(uint flags);

		public static int GetWindowHandle(Window window)
		{
			return new WindowInteropHelper(window).Handle.ToInt32();
		}
	}
}
